<template>
  <div class="nav-box w">
    <div>
      <img class="logo pointer hover" src="@/assets/imgs/logo.png" alt />
    </div>
    <div class="nav-list">
      <div
        :class="['item pointer', $route.path == item.url ? 'item-active' : '']"
        v-for="item in navList"
        :key="item.id"
        @click="handNav(item)"
      >
        {{ item.name }}
      </div>
    </div>
    <div class="nav-phone">
      400-665-7756
    </div>
  </div>
</template>

<script>
export default {
  name: 'Home',
  components: {},
  data() {
    return {
      navList: [
        {
          id: 0,
          name: '首页',
          url: '/',
        },
        {
          id: 1,
          name: '关于我们',
        },
        {
          id: 2,
          name: '项目案例',
        },
        {
          id: 3,
          name: '交互体验',
        },
        {
          id: 4,
          name: '联系我们',
        },
      ],
    }
  },
  methods: {
    handNav(item) {
      this.$router.push(item.url)
    },
  },
}
</script>
<style lang="scss" scoped>
@import '@/assets/css/base.scss';
.nav-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  .nav-phone {
    font-size: 16px;
    color: $base-color;
  }
  .logo {
    width: 150px;
  }
  .nav-list {
    display: flex;
    .item {
      font-size: 16px;
      color: #333;
      margin-right: 80px;
      &:hover {
        color: $base-color;
      }
      &:last-child {
        margin-right: 0;
      }
    }
    .item-active {
      color: $base-color;
    }
  }
}
</style>
